// Record 约束对象的键值,接受两个泛型
type Key1 = 'c'|'x'|'k'
type Value1 = '唱'|'跳'| 'rap'

let ooo:Record<Key1,Record<Key1,Value1>> ={      //键不能少，值随便，可重复（可嵌套）
    c:{
        c:'唱',
        x:'跳',
        k:'rap'
    },
    x:{
        c:'唱',
        x:'唱',
        k:'rap'
    },
    k:{
        c:'rap',
        x:'rap',
        k:'rap'
    },
} 
// 原理实现
type oK = string |number |symbol
type objKey = keyof any
type MyReCord<K extends objKey,T> = {
    [P in K]:T
}


// ReturnType  检测返回类型
const fon = () =>[1,2,'asdf',false]
type arrNum = ReturnType<typeof fon>    //(string | number | boolean)[]
// 原理实现
type myReturnType<F extends Function> = F extends (...args:any[])=> infer Res?Res:never
type CoustomerReturnType = myReturnType<typeof fon>